package com.zc.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class TelManagerActivity extends Activity implements OnClickListener {

	TextView[] title = new TextView[8];
	int[] id = { R.id.dinnerTel, R.id.publicService, R.id.yunyingshang, R.id.kuaidi, R.id.jipiao, R.id.yinhang,
			R.id.baoxian, R.id.pingpai };
	ImageView back;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_tel_manager);
		for (int i = 0; i < id.length; i++) {
			title[i] = (TextView) findViewById(id[i]);
			title[i].setOnClickListener(this);
		}
		back = (ImageView) findViewById(R.id.back);
		back.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v.getId() == R.id.back) {
			startActivity(new Intent(this, MenuActivity.class));
		} else {
			for (int i = 0; i < id.length; i++) {
				if (v.getId() == id[i]) {
					Intent intent = new Intent(this, TelShowActivity.class);
					intent.putExtra("num", i+1);
					startActivity(intent);
					break;
				}
			}
		}

	}

}
